﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FactortMethod
{
    /// <summary>
    /// Interface will hold object
    /// </summary>
    public interface IFruit
    {
        string GetDescription();
    }

    /// <summary>
    /// concreate object
    /// </summary>
    public class Apple : IFruit
    {
        public string GetDescription()
        {
            return "I'm an Apple....!";
        }
    }

    /// <summary>
    /// 
    /// </summary>
    public class Orange : IFruit
    {
        public string GetDescription()
        {
            return "I'm an Orange....!";
        }
    }

    /// <summary>
    /// 
    /// </summary>
    public interface IFruitFactory
    {
        IFruit CreateApple();
        IFruit CreateOrange();
    }

    /// <summary>
    /// 
    /// </summary>
    public class FruitFactory : IFruitFactory
    {
        public IFruit CreateApple()
        {
            return new Apple();
        }

        public IFruit CreateOrange()
        {
            return new Orange();
        }
    }
}
